package com.smalljj.dao.impl;

import com.smalljj.bean.Position;
import com.smalljj.dao.PositionDao;

public class PositionDaoImpl extends MiddleAbstractDao<Position> implements PositionDao {
	
	private String tableName;

	/**
	 * 实体类名即表名，如果不是，子类请重载
	 */
	@Override
	protected String tableName() {
		return tableName;
	}
	
	@Override
	protected Class<Position> getEntityClass() {
		return Position.class;
	}
	
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@Override
	public void insert(String tableName, Position position) throws Exception {
		setTableName("position_"+tableName);
		super.insert(position);
	}
	
	
}
